package com.ayic.garbagerecycle.pojo;

import org.springframework.core.io.InputStreamResource;

import java.io.InputStream;

/**
 * @author AyiC416
 * @ClassName garbagerecycle
 * @date 2025/4/16
 * @Description TODO
 */
public class MultipartInputStreamFileResource extends InputStreamResource {
    private final String filename;

    public MultipartInputStreamFileResource(InputStream inputStream, String filename) {
        super(inputStream);
        this.filename = filename;
    }

    @Override
    public String getFilename() {
        return this.filename;
    }

    @Override
    public long contentLength() {
        return -1; // We do not know the content length in advance
    }
}
